#ifndef VFS_H
#define VFS_H

struct inode_st;

typedef unsigned int (*read_type_t)(struct inode_st*, unsigned int offset, unsigned int length, unsigned char *buffer);
typedef unsigned int (*write_type_t)(struct inode_st*, unsigned int offset, unsigned int length, unsigned char *buffer);
typedef void (*open_type_t)(struct inode_st*);
typedef void (*close_type_t)(struct inode_st*);
typedef struct dirent * (*readdir_type_t)(struct inode_st*, unsigned int);
typedef struct inode_st * (*finddir_type_t)(struct inode_st*, char *name); 

typedef struct inode_st
{
	unsigned int ino;
	unsigned char name[128];
	unsigned int flags;
	read_type_t read;
	write_type_t write;
	open_type_t open;
	close_type_t close;
	readdir_type_t readdir;
	finddir_type_t finddir;
} inode;


struct dirent
{
	char name[128];
	unsigned int ino;
};

#define FS_FILE			0x01
#define FS_DIRECTORY	0x02
#define FS_CHARDEVICE	0x04
#define FS_BLOCKDEVICE	0x08

extern inode *fs_root;

#endif
